package fcl.pattern;


import fcl.platform.R;

import android.app.Activity;

import android.os.Bundle;

import android.view.View;
import android.view.View.OnClickListener;

import android.widget.Button;
import android.widget.LinearLayout;


import android.widget.ScrollView;


public class PatternActivity extends Activity {

	private DataProcessing data = null;
	Button button;
	
    LinearLayout v;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
//		requestWindowFeature(Window.FEATURE_NO_TITLE);

		setContentView(R.layout.pattern);
		


		data = new DataProcessing();

		button = (Button) findViewById(R.id.refreshbutton2);

		button.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				refreshpattern();
			}
		});
		
	
		
		   v = (LinearLayout) findViewById(R.id.linnnnlayout);
//		 
		  
		  PatternPanel myView = new PatternPanel(this);
//			
		  myView.setData(data);
		  
		  v.addView(myView);
		    

	}

	private void refreshpattern() {
		// TODO Auto-generated method stub

		data.reload();
		
		v.removeViewAt(1);
		
		PatternPanel myView = new PatternPanel(this);
//		
	    myView.setData(data);
	  
	    v.addView(myView);
		
	}

	
	

}
